//
//  LZFTagButton.m
//  LZFBuDieJie
//
//  Created by 梁梓烽 on 16/7/11.
//  Copyright © 2016年 liangzifeng. All rights reserved.
//

#import "LZFTagButton.h"

@implementation LZFTagButton


-(instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        self.backgroundColor=[UIColor blueColor];
        [self setImage:[UIImage imageNamed:@"chose_tag_close_icon"] forState:UIControlStateNormal];
     
    }
    return self;
}


-(void)setTitle:(NSString *)title forState:(UIControlState)state
{
    [super setTitle:title forState:state];
    [self sizeToFit];
    self.xmg_height=LZFTagButtonHeight;
    self.xmg_width+=3*LZFSmallMargin;
 
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLabel.xmg_x=LZFSmallMargin;
    self.imageView.xmg_x=CGRectGetMaxX(self.titleLabel.frame)+LZFSmallMargin;
    
}
@end
